package com.bosssoft.trainee.rbac.service.impl;

import com.bosssoft.trainee.rbac.entity.dto.RolesDTO;
import com.bosssoft.trainee.rbac.service.RolesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RolesServiceImpl implements RolesService {
    @Autowired
    private RolesService rolesService;

    @Override
    public int insertRole(RolesDTO rolesDTO) {
        return rolesService.insertRole(rolesDTO);
    }

    @Override
    public int insertRoleMenu(RolesDTO rolesDTO, List<Integer> menuIdList) {
        return rolesService.insertRoleMenu(rolesDTO,menuIdList);
    }

    @Override
    public int deleteRole(RolesDTO rolesDTO) {
        return rolesService.deleteRole(rolesDTO);
    }

    @Override
    public int updateRolesName(RolesDTO rolesDTO) {
        return rolesService.updateRolesName(rolesDTO);
    }

    @Override
    public List<RolesDTO> getUserRoles(Integer userId) {
        return rolesService.getUserRoles(userId);
    }

    @Override
    public List<RolesDTO> getAllRoles() {
        return rolesService.getAllRoles();
    }
}
